import { ref } from "vue";
import { defineStore } from "pinia";

export const useUserStore = defineStore(
  "user-store",
  () => {
    const user = ref({
      avatar: "",
      uname: "",
      uid: 0,
    });

    const setUser = (userInfo) => {
      user.value = userInfo;
    };

    const reSet = () => {
        user.value = null;
    };

    return { user, setUser , reSet};
  },
  {
    persist: true,
  }
);
